Skip to content

refactor(content-blog): decouple getTagsFile from generateBlogPosts#11707

Merged
slorber merged 2 commits intofacebook:mainfrom
garry00107:refactor/content-blog-generate-posts
Feb 6, 2026
Merged

refactor(content-blog): decouple getTagsFile from generateBlogPosts#11707
slorber merged 2 commits intofacebook:mainfrom
garry00107:refactor/content-blog-generate-posts

Conversation

@garry00107
Copy link
Contributor

@garry00107 garry00107 commented Feb 1, 2026

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

This PR refactors generateBlogPosts in packages/docusaurus-plugin-content-blog/src/blogUtils.ts to improve the separation of concerns, addressing an existing TODO in the codebase.

Previously, generateBlogPosts was responsible for loading the tags file internally via getTagsFile. This change moves that responsibility to the caller (loadContent in index.ts), making generateBlogPosts a pure function of its inputs with respect to the tags file.

Test Plan

I verified the changes by running the unit tests for the docusaurus-plugin-content-blog package.

Command:

yarn test packages/docusaurus-plugin-content-blog

### Test links

Deploy preview: https://deploy-preview-11707--docusaurus-2.netlify.app/

@meta-cla
Copy link

meta-cla bot commented Feb 1, 2026

Hi @garry00107!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify
Copy link

netlify bot commented Feb 1, 2026

[V2]

Name Link
🔨 Latest commit 6420140
🔍 Latest deploy log https://app.netlify.com/projects/docusaurus-2/deploys/6985cc106f674f0008b0b021
😎 Deploy Preview https://deploy-preview-11707--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@meta-cla
Copy link

meta-cla bot commented Feb 1, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla bot added the CLA Signed Signed Facebook CLA label Feb 1, 2026
@socket-security
Copy link

@socket-security
Copy link

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/@docusaurus/preset-classic@3.9.2npm/@docusaurus/core@3.9.2npm/entities@4.5.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@4.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/@docusaurus/preset-classic@3.9.2npm/@docusaurus/core@3.9.2npm/entities@6.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@6.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm html-minifier-terser is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: ?npm/@docusaurus/core@3.9.2npm/html-minifier-terser@7.2.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/html-minifier-terser@7.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@slorber slorber added the pr: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient. label Feb 6, 2026
@slorber slorber merged commit 6635ca3 into facebook:main Feb 6, 2026
45 of 46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Signed Facebook CLA pr: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants